<form id="info-form" class="form-horizontal" role="form" method="post" >
    <input type="hidden" name="update" value="pass">
    <input type="hidden" name="_wpnonce" value="18801d4991">
    <input type="hidden" name="user.id" value="${USER.id}" >
    <input type="hidden" name="option" value="oppass">
    <div class="page-header">
        <h3 id="pass">账号安全 <small>仅自己可见</small></h>
    </div>
    <div class="form-group">
        <label for="email" class="col-sm-3 control-label">电子邮件 (必填)</label>
        <div class="col-sm-9">
            <input type="text" disabled class="form-control" id="email" name="email" value="${(USER.email)!}" aria-required='true' required>
        </div>
    </div>
    <div class="form-group">
        <label for="pass1" class="col-sm-3 control-label">新密码</label>
        <div class="col-sm-9">
            <input type="password" class="form-control" id="pass1" name="pass1" >
            <span class="help-block">如果您想修改您的密码，请在此输入新密码。不然请留空。</span>
        </div>
    </div>
    <div class="form-group">
        <label for="pass2" class="col-sm-3 control-label">重复新密码</label>
        <div class="col-sm-9">
            <input type="password" class="form-control" id="pass2" name="pass2" >
            <span class="help-block">再输入一遍新密码。 提示：您的密码最好至少包含7个字符。为了保证密码强度，使用大小写字母、数字和符号（例如! " ? $ % ^ & )）。</span>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-3 col-sm-9">
            <button id="profile_sub" type="submit" class="btn btn-primary">保存更改</button>
            <div id="editRealMsgImg">提交中....</div>
        </div>
    </div>
    <script>
        $("#editRealMsgImg").hide();
        $("#profile_sub").click(function () {
            jQuery.ajax({
                url: '${CPATH}/member/save.html',
                data: $('#info-form').serialize(),
                type: "POST",
                beforeSend: function () {
                    $('#profile_sub').hide();
                    $('#editRealMsgImg').show();
                },
                success: function (data) {
                    if (data.errorCode != 1) {
                        alert(data.message);
                        $('#editRealMsgImg').hide();
                        $('#profile_sub').show();
                    } else if(data.errorCode ==1){
                        alert("更新成功");
                        $('#editRealMsgImg').hide();
                        $('#profile_sub').show();
                    }
                }
            });
            return false;
        });

    </script>
</form>